package com.wdciti.sccp.iot.gateway.domain.dto;


import com.alibaba.fastjson.JSONObject;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class AreaCoordinateDTO {

    private float xCoordinate;

    private float yCoordinate;

    /*长*/
    private float length;

    /*宽*/
    private float width;

    private float extraRange;

    private String shape;

    private double radius;

    public AreaCoordinateDTO(JSONObject riskArea){
        this.xCoordinate = riskArea.getFloat("xCoordinate");
        this.yCoordinate = riskArea.getFloat("yCoordinate");
        this.width = riskArea.getFloat("width");
        this.length = riskArea.getFloat("length");
        this.extraRange = 0;
        this.shape = riskArea.getString("shape");
        this.radius = riskArea.getDouble("radius");
    }

}
